import java.io.*;
import java.util.*;

public class Renamer {
  Scanner sc;
  public void rename(int i) {
    try {
      sc = new Scanner(new FileReader("elementlist.txt"));
    }
    catch(Exception e) {
      System.out.println("Error1");
    }
      sc.useDelimiter(" ");
      while(sc.hasNext()) {
        if(sc.nextInt() == i) {
            sc.next();
            sc.next();
            sc.next();
            String s = sc.next();
            System.out.println(s);
            try {
              File f = new File("Element"+i+"(resized).png");
              f.renameTo(new File(s+".png"));
            }
            catch(Exception e) {
            }
            return;
          }
          else {
            sc.nextLine();
            System.out.println("here"+i);
          }
        }
      }
    }